package com.hyt.it.ogt.pj.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hyt.it.ogt.pj.model.entity.Piece;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 评卷块表 Mapper 接口
 * </p>
 *
 * @author qiaozj
 * @since 2020-07-09
 */
public interface PieceMapper extends BaseMapper<Piece> {

    List<Piece> selectBySubject(@Param("subjectId") String subjectId);
    
    List<Piece> selectByProjectAndSubjectId(@Param("projectId") String projectId, @Param("subjectId") String subjectId);

    Piece getTeacherPiece(@Param("projectId") String projectId, @Param("subjectId") String subjectId, @Param("userId") String userId);

    List<Piece> getTaskPiece(@Param("projectId") String projectId, @Param("subjectId") String subjectId, @Param("parentId") String parentId);

    Piece getParentPiece(@Param("projectId") String projectId, @Param("subjectId") String subjectId, @Param("pieceId") String pieceId);

    void updateFinishStatus(@Param("projectId") String projectId, @Param("subjectId") String subjectId, @Param("pieceId") String pieceId, @Param("status") Boolean status);

    Piece selectPaperPiece(@Param("projectId")String projectId, @Param("subjectId")String subjectId, @Param("paperId")String paperId);

    List<Piece> selectByProjectIdSubjectId(
            @Param("projectId")String projectId,
            @Param("subjectId") String subjectId);
}
